<div class="row" style="border-bottom: 10px solid #EFEFEF;padding:10px;">
	<div class="col-lg-8">
		<div class="ukefu-measure">
			<div class="ukefu-bt"> 
				<div	class="layui-icon ukewo-btn ukefu-content-ind"><img src="/images/weixin.jpg" style="width:60px;height:60px;"></div>
				<div class="ukefu-bt-text">
					<div class="ukefu-bt-text-title"
						style="font-weight:400;font-size:24px;border-bottom:1px solid #dedede;">
							${snsAccount.name!''}
							<span style="font-size:15px;color:#AAAAAA;">公众号创建时间：${snsAccount.createtime!?string("yyyy-MM-dd HH:mm:ss")}</span>
					</div>
					<div class="ukefu-bt-text-content" style="">${snsAccount.name!''}</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-lg-4">
		<form class="layui-form" action="/admin/weixin/update.html"	method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">
					人工坐席：
				</label>
				<div class="layui-input-block ukefu-agent-switch" style="padding-top:0px;">
					<input type="checkbox" name="switch" <#if snsAccount.agent?? && snsAccount.agent == true>checked</#if> lay-filter="agent" lay-skin="switch" value="1" lay-text="开启|关闭">
				</div>
			</div>
		</form>
	</div>
</div>
<div class="row" style="border-bottom: 10px solid #EFEFEF;padding:10px;">
	<div class="col-lg-12">
		<span style="font-weight:600;">接口地址：</span>${schema!''}://${hostname!''}<#if port?? && port != '80'>:${port?string('###')}</#if>/im/weixin/<#if snsAccount.moreparam?? && snsAccount.moreparam == 'auth'>${snsAccount.appkey!''}
	<#else>${snsAccount.snsid!''}</#if>
		<span style="font-weight:600;margin-left:50px;">Token：</span>${snsAccount.token!''}
		<span style="font-weight:600;margin-left:50px;">AppID：</span>${snsAccount.appkey!''}	
	</div>
</div>
<div class="ukefu-tab-title" style="margin-left: 0px;">
	<#include "/admin/channel/weixin/include/top.html">
</div>
<div class="layui-tab">
  <div class="layui-tab-content">
    <div class="layui-tab-item layui-show">
    	<div class="row" style="border-bottom: 10px solid #EFEFEF;padding:10px;">
			<div class="col-lg-12">
				<h1 class="site-h1">在线客服业务概况</h1>
				<div class="row">
						<div class="col-lg-3">
							<div class="ukefu-measure">
								<i class="layui-icon ukewo-weixin-btn ukefu-weixin-measure-btn"></i>
								<div class="ukefu-weixin-text">
									<div class="ukefu-weixin-text-title">新增关注数</div>
								</div>
								<div class="ukefu-weixin-today">
									<div class="ukefu-weixin-text-today">${today.subs}</div>
									今天新增关注数
								</div>
								<div class="ukefu-weixin-last">
									昨天新增关注数
									<div class="ukefu-weixin-text-last">${lastday.subs}</div>
								</div>
								<div class="ukefu-weixin-last">
									7天新增关注数
									<div class="ukefu-weixin-text-last">${last7day.subs}</div>
								</div>
								<div class="ukefu-weixin-last">
									30天新增关注数
									<div class="ukefu-weixin-text-last">${last30day.subs}</div>
								</div>
							</div>
						</div>
						<div class="col-lg-3">
							<div class="ukefu-measure">
								<i
									class="kfont icon-iconfontagent ukewo-weixin-btn ukefu-weixin-measure-btn ukefu-bg-color-yellow"></i>
								<div class="ukefu-weixin-text">
									<div class="ukefu-weixin-text-title">取消关注数</div>
								</div>
								<div class="ukefu-weixin-today">
									<div class="ukefu-weixin-text-today">${today.unsubs}</div>
									今天取消关注数
								</div>
								<div class="ukefu-weixin-last">
									昨天取消关注数
									<div class="ukefu-weixin-text-last">${lastday.unsubs}</div>
								</div>
								<div class="ukefu-weixin-last">
									7天取消关注数
									<div class="ukefu-weixin-text-last">${last7day.unsubs}</div>
								</div>
								<div class="ukefu-weixin-last">
									30天取消关注数
									<div class="ukefu-weixin-text-last">${last30day.unsubs}</div>
								</div>
							</div>
						</div>
						<div class="col-lg-3">
							<div class="ukefu-measure">
								<i
									class="layui-icon ukewo-weixin-btn ukefu-weixin-measure-btn ukefu-bg-color-pink"></i>
								<div class="ukefu-weixin-text">
									<div class="ukefu-weixin-text-title">净增关注数</div>
								</div>
								<div class="ukefu-weixin-today">
									<div class="ukefu-weixin-text-today">${today.subs - today.unsubs}</div>
									今天净增关注数
								</div>
								<div class="ukefu-weixin-last">
									昨天净增关注数
									<div class="ukefu-weixin-text-last">${lastday.subs - lastday.unsubs}</div>
								</div>
								<div class="ukefu-weixin-last">
									7天净增关注数
									<div class="ukefu-weixin-text-last">${last7day.subs - last7day.unsubs}</div>
								</div>
								<div class="ukefu-weixin-last">
									30天净增关注数
									<div class="ukefu-weixin-text-last">${last30day.subs - last30day.unsubs}</div>
								</div>
							</div>
						</div>
						<div class="col-lg-3">
							<div class="ukefu-measure">
								<i
									class="layui-icon ukewo-weixin-btn ukefu-weixin-measure-btn ukefu-bg-color-green"></i>
								<div class="ukefu-weixin-text">
									<div class="ukefu-weixin-text-title">客服咨询数</div>
								</div>
								<div class="ukefu-weixin-today">
									<div class="ukefu-weixin-text-today">${todayService!0}</div>
									今天客服咨询数
								</div>
								<div class="ukefu-weixin-last">
									昨天客服咨询量
									<div class="ukefu-weixin-text-last">${lastdayService!0}</div>
								</div>
								<div class="ukefu-weixin-last">
									7天客服咨询量
									<div class="ukefu-weixin-text-last">${last7dayService!0}</div>
								</div>
								<div class="ukefu-weixin-last">
									30天客服咨询量
									<div class="ukefu-weixin-text-last">${last30dayService!0}</div>
								</div>
							</div>
						</div>
					</div>
			</div>
		</div>
    	<div class="row">
			<div class="col-lg-12">
				<h1 class="site-h1" style="border-top:1px solid #e6e6e6;">
					进行中的对话<#if agentServiceList??>（${agentServiceList.totalElements}）</#if>
				</h1>
				<table class="layui-table" lay-skin="line">
					<thead>
						<tr class="design-sortable-tr">
							<th>用户名</th>
							<th>接入渠道</th>
							<th>服务坐席</th>
							<th>咨询时间</th>
							<th>服务时间</th>
							<th>等待时长</th>
							<th>地域</th>
							
						</tr>
					</thead>
					<tbody>
						<#if agentServiceList?? && agentServiceList.content?? && agentServiceList.content?size gt 0>
						<#list agentServiceList.content as agentService>
						<tr class="tdHasContorllor design-dropable-td">
							<td class=" first_td_head">
								<a href="/service/online/index.html?userid=${agentService.userid!''}&agentservice=${agentService.id!''}">
								${agentService.username!''}
								</a>
							</td>
							<td>
								${agentService.channel!''}
							</td>
							<td>
								<#if userList??>
									<#list userList as user>
										<#if user.id == agentService.agent>${user.username!''}</#if>
									</#list>
								</#if>
							</td>
							<td><#if agentService.logindate??>${agentService.logindate?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
							<td>
								<#if agentService.servicetime??>
								${agentService.servicetime?string('yyyy-MM-dd HH:mm:ss')}
								</#if>
							</td>
							<td>
								${(agentService.waittingtime/(1000*60*60))?string('00')}:${((agentService.waittingtime%(1000*60*60))/(1000*60))?string('00')}:${((agentService.waittingtime%(1000*60))/(1000))?string('00')}
							</td>
							<td class=" ">${agentService.region!''}</td>
						</tr>
						</#list>
						<#else>
							<tr>
								<td colspan="20" style="height:400px;">
									<div class="ukefu-empty">
										<i class="layui-icon">&#xe63a;</i>
										<div style="">当前没有进行中的对话</div>
									</div>
								</td>
							</tr>
						</#if>
					</tbody>
				</table>

			</div>
		</div>
    </div>
    <div class="layui-tab-item">内容2</div>
    <div class="layui-tab-item">内容3</div>
    <div class="layui-tab-item">内容4</div>
    <div class="layui-tab-item">内容5</div>
  </div>
</div>

<script>
	layui.use('form', function() {
		var form = layui.form;
		form.render(); //更新全部
		form.on("switch(agent)" , function(data){
			if(data.elem.checked){
				loadURL("/admin/weixin/enable.html?id=${snsAccount.id!''}" , null , function(){
					top.layer.alert('启用人工坐席', {icon: 1});
				});
			}else{
				loadURL("/admin/weixin/disable.html?id=${snsAccount.id!''}" , null , function(){
					top.layer.alert('关闭人工坐席', {icon: 1});
				});
			}
		})
	});
	layui.use('element', function(){
		var element = layui.element;
	});
</script>